/*
Time :2021-04-16 15:29:20
author :selfeasy
email :selfeasy@qq.com
desc: time kit
*/

package utils

import (
	"time"
)

// var t = time.Now()

// get current time string yyyy-mm-dd hh:mm:ss
func CurrentDateTimeStr() string {
	cur := time.Now().Format("2006-01-02 15:04:05") //fixed format2006-01-02 15:04:05
	return cur
}

// hh:mm:ss
func CurrentTimeStr() string {
	cur := time.Now().Format("15:04:05")
	return cur
}

//timestamp
func TimeStamp() int64 {
	return time.Now().Unix()
}

// today zero timestamp
func TimeStampZero() int64 {
	cut := time.Now().Format("2006-01-02")
	timeNumber, _ := time.ParseInLocation("2006-01-02", cut, time.Local)
	return timeNumber.Unix()
}
